﻿using Kiwi.Infrastructure;
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using Kiwi.DataModel;

namespace Kiwi.ViewModel
{
    public class ViewModelBase : NotificationObject
    {
        public ViewModelBase()
        {
            if (!string.IsNullOrWhiteSpace(RssUrl))
            {
                Request();
            }
        }

        protected virtual string RssUrl
        {
            get {
                return string.Empty;
            }
        }

        protected virtual void Request()
        {
            
        }

        public virtual string Title
        {
            get;
            set;
        }

        private ObservableCollection<CommentInfo> commentsCollection;
        public ObservableCollection<CommentInfo> CommentCollection
        {
            get { return commentsCollection; }
            set
            {
                commentsCollection = value;
                RaisePropertyChanged(() => CommentCollection);
            }
        }

        private ObservableCollection<NewsInfo> newsCollection;
        public ObservableCollection<NewsInfo> NewsCollection
        {
            get { return newsCollection; }
            set
            {
                newsCollection = value;
                RaisePropertyChanged(() => NewsCollection);
            }
        }
    }
}
